/**
 * 
 */
package archsw0904.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;



/**
 * @author ASGroup0904
 *
 */

@Entity
public class Authenticated implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int id; //is the token
	private ProfileUser user;
	private Date lastAccess ;
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	@OneToOne(targetEntity=ProfileUser.class)
//	@PrimaryKeyJoinColumn
	@JoinColumn(name="user_id")
	public ProfileUser getUser() {
		return user;
	}
	
	public void setUser(ProfileUser user) {
		this.user = user;
	}
	
	public Date getLastAccess() {
		return lastAccess;
	}
	
	public void setLastAccess(Date lastAccess) {
		this.lastAccess = lastAccess;
	}
	
}
